<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="x" uri="/WEB-INF/tags/coretag.tld" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <%@ include file="/WEB-INF/include/include.jsp" %>
  </head>
  <body> 
  <script type="text/javascript">
  	function convertName(value,record){
  		return value+"22";
  	}
	function renderName(value){
		return '<font color=\'green\'>'+value+'</font>';
	};
  </script>
  <div id="gridWrap"></div>
  <ui:page>
  
  	<ui:model name="Resource">
  		<x:attr name="fields" type="array">
  			<ui:model.field name="id"  convert="convertName" ></ui:model.field>
  			<ui:model.field name="resource_name" type="string"  convert="convertName" ></ui:model.field>
  			<ui:model.field name="resource_type" type="string"   ></ui:model.field>
  		</x:attr>
  	</ui:model>
  
    <ui:grid id="mygrid"  datasetName="TestDataSetHandler"  showPaging="true" pageSize="5"
  	handlerName="TestQueryHandler" model="Resource"
  	 showCheckbox="true" singleSelect="true"  editable="true" renderTo="gridWrap">
	  <x:columns>
	  	  <ui:gridcolumn text="id" dataIndex="id" ></ui:gridcolumn>
		  <ui:gridcolumn text="名称" dataIndex="resource_name" renderer="renderName">
		  	<x:attr name="editor">
		  		<ui:formPanel.text config="true"></ui:formPanel.text>
		  	</x:attr>
		  </ui:gridcolumn>
		  <ui:gridcolumn text="类型" dataIndex="resource_type"></ui:gridcolumn>
	  </x:columns>
  </ui:grid>
  
  
  
  </ui:page>

  
  </body>
</html>
